package cn.com.api.mapper.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiU_discover_comment;

//DAO
public interface U_discover_commentMapperBase {

	// 根据id查看
	@Select("SELECT * FROM U_DISCOVER_COMMENT  WHERE COMMENT_ID = #{comment_id}")
	public ApiU_discover_comment findU_discover_commentById(Integer comment_id);

	// 查看数据集
	@Select("SELECT * FROM U_discover_comment")
	public List<ApiU_discover_comment> findU_discover_comments();

	// 根据条件查看数据集
	public List<Map<String, Object>> findU_discover_commentsByMap(HashMap condition);

	// 添加
	@Insert("INSERT INTO U_DISCOVER_COMMENT (TITLE, FORUM_TITLE, CONTENT, CREATE_TIME, TYPE, TARGET_ID, USER_ID, USER_NAME, IF_EFFECT, IS_DELETE, RELAY_ID, REPLY_COUNT, GOOD_COUNT, BAD_COUNT, CLICK_COUNT, FAV_COUNT) VALUES (#{title}, #{forum_title}, #{content}, #{create_time}, #{type}, #{target_id}, #{user_id}, #{user_name}, #{if_effect}, #{is_delete}, #{relay_id}, #{reply_count}, #{good_count}, #{bad_count}, #{click_count}, #{fav_count})")
	@Options(useGeneratedKeys = true, keyProperty = "comment_id")
	public int insertU_discover_comment(ApiU_discover_comment u_discover_comment);

	// 修改
	@Update("UPDATE U_DISCOVER_COMMENT SET TITLE = #{title}, FORUM_TITLE = #{forum_title}, CONTENT = #{content}, CREATE_TIME = #{create_time}, TYPE = #{type}, TARGET_ID = #{target_id}, USER_ID = #{user_id}, USER_NAME = #{user_name}, IF_EFFECT = #{if_effect}, IS_DELETE = #{is_delete}, RELAY_ID = #{relay_id}, REPLY_COUNT = #{reply_count}, GOOD_COUNT = #{good_count}, BAD_COUNT = #{bad_count}, CLICK_COUNT = #{click_count}, FAV_COUNT = #{fav_count} WHERE COMMENT_ID = #{comment_id}")
	public int updateU_discover_comment(ApiU_discover_comment u_discover_comment);

	// 删除
	@Delete("DELETE FROM U_DISCOVER_COMMENT  WHERE COMMENT_ID = #{comment_id}")
	public int deleteU_discover_comment(Integer comment_id);

	// Foreign keys revelant

	// region Indexs revelant

}
